 //myspider.cpp : Defines the entry point for the console application.


#include "stdafx.h"
#include "Argument.h"
#include "mthread.h"
#include "winmider.h"


CRISEC g_Nofity;

int _tmain(int argc, char* argv[])
{
	CWinmider winminder;
	CArgument arg( argc, argv);
	TCHAR szPath[MAX_PATH];
	_tcscpy( szPath , argv[0]);
	LPCSTR szIniFile = arg.get("-ini");

	LPTSTR pch;
	pch = _tcsrchr( szPath , '\\');
	if (pch== NULL)
	{
		strcpy(szPath , ".\\");
	}else{
		szPath[ pch - szPath + 1] =  0 ;
	}

	if (szIniFile==NULL)
	{
		printf("Usage -ini <initialize file> \r\n") ; 
		return 0;
	}else{
		winminder.iniFileName = szIniFile;
		winminder.m_szPath = szPath;
		winminder.SetPath();
		winminder.IniFileRead();
		winminder.Start();
		//CriticalSectionInit( &g_Nofity);
		//CriticalSectionFree( &g_Nofity);
	}
	return 0;
}

